//
//  HQNetRequestTool.h
//  WenDuEducation
//
//  Created by 黄华强 on 2017/8/1.
//  Copyright © 2017年 黄华强. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import "PLUpdateVideoModel.h"

//定义返回请求数据的block类型
typedef void (^ReturnValueBlock) (id returnValue);
typedef void (^ErrorCodeBlock) (NSError *errorCode);


@interface HQNetRequestTool : NSObject


@property (nonatomic, getter=isNetWorkCanUse) BOOL netWorkCanUse;

//单例初始化方法
+ (instancetype)sharedHQNetRequestTool;

#pragma 监测网络的可链接性
- (BOOL) netWorkReachabilityWithURLString:(NSString *) strUrl;

#pragma mark - GET请求
+ (void) GETRequestURLString: (NSString *) requestURLString
                  parameter: (NSDictionary *) parameter
                 valeuBlock: (ReturnValueBlock) valueBlock
                 errorBlock: (ErrorCodeBlock) errorBlock;
#pragma mark - POST表单请求
+ (void) POSTFormRequestURLString: (NSString *) requestURLString
                       parameter: (NSDictionary *) parameter
                      valeuBlock: (ReturnValueBlock) valueBlock
                      errorBlock: (ErrorCodeBlock) errorBlock;
#pragma mark - POST JSON请求
+ (void) POSTJSONRequestURLString: (NSString *) requestURLString
                       parameter: (NSDictionary *) parameter
                      valeuBlock: (ReturnValueBlock) valueBlock
                      errorBlock: (ErrorCodeBlock) errorBlock;

//上传图片数组
+ (void)requestWithImageDictArray: (NSArray<NSDictionary<NSString *,UIImage *> *> *) dataDictArr
                 requestURLString: (NSString *) requestURLString
                        parameter: (NSDictionary *) parameter
                       valeuBlock: (ReturnValueBlock) valueBlock
                       errorBlock: (ErrorCodeBlock) errorBlock;


@end
